import {
    FormItemType
} from 'assets/js/Constant'

const columns = [{
    title: '编号',
    dataIndex: 'id',
    key: 'id',
    slots: {
        title: 'id',
        customRender: 'id'
    },
}, {
    title: '角色组名称',
    dataIndex: 'ruleGroupName',
    key: 'ruleGroupName',
    slots: {
        customRender: 'ruleGroupName'
    },
}, {
    title: '角色组类型',
    dataIndex: 'ruleGroupType',
    key: 'ruleGroupType',
    slots: {
        customRender: 'ruleGroupType'
    },
},
{
    title: '创建时间',
    dataIndex: 'createTime',
    key: 'createTime',
    slots: {
        customRender: 'createTime'
    }
},
{
    title: '操作',
    key: 'action',
    slots: {
        customRender: 'action'
    },
},
];

const searchFormSchema = {
    options: {
        labelCol: 0,
        wrapperCol: 20,
        layout: 'inline',
    },
    groups: [
        {
            fields: [
                {
                    type: FormItemType.INPUT,
                    label: "角色组名称",
                    name: "ruleGroupName"
                },
                {
                    type: FormItemType.SELECT,
                    label: "角色组类型",
                    name: "ruleGroupType",
                    sourceData: [{ id: 2, name: "管理组" }, { id: 3, name: '注册组' }],
                    props: { label: 'name', value: 'id' },
                },

            ]
        }
    ]
};

const ruleGroupFormSchema = {
    options: {
        labelCol: 6,
        wrapperCol: 18,
        layout: 'vertical',
    },
    groups: [
        {
            fields: [
                {
                    type: FormItemType.INPUT,
                    label: "角色组名称",
                    name: "ruleGroupName",
                    placeholder: "请输入角色组名称",
                    rules: [{ required: true, message: '请输入角色组名称' }],
                },
                {
                    type: FormItemType.SELECT,
                    label: "角色组类型",
                    name: "ruleGroupType",
                    placeholder: "请选择角色组类型",
                    rules: [{ required: true, message: '请选择角色组类型' }],
                    sourceData: [{ id: 2, name: "管理组" }, { id: 3, name: '注册组' }],
                    props: { label: 'name', value: 'id' },
                }
            ]
        }
    ]
};

export default {
    columns: columns,
    searchFormSchema: searchFormSchema,
    ruleGroupFormSchema: ruleGroupFormSchema
}